package com.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;

import com.demo.Demo;
import com.model.Config;
import com.model.SpiderInfo;
import com.util.ConnectDB;

public class SpiderDAO {
	private Connection conn;
	private String sql_getspiderinf;
	private PreparedStatement ps;
	public void addSpider(SpiderInfo sp) throws Exception
	{
		this.conn=ConnectDB.getDBConnect();
		this.sql_getspiderinf="insert tb_url values(?,?,?,?,?,?,?)";
		ps=conn.prepareStatement(sql_getspiderinf);
		ps.setInt(1, 0);
		ps.setInt(2, sp.getCid());
		ps.setString(3, sp.getUrl());
		ps.setString(4, sp.getOrder());
		ps.setString(5, sp.getUrlpr());
		ps.setString(6, sp.getHrex());
		ps.setString(7, sp.getCrex());
		ps.execute();
		ps.close();
		conn.close();
	}
}
